import request from '@/utils/request'

// 多条件查询优惠卷分页列表
export function listCoupon(data) {
  return request({
    url: '/coupon/coupon/merchantCouponList',
    method: 'post',
    data: data
  })
}
// B端 发布优惠劵页面 通过商铺id查询所有商品
export function publishAllItemsInCoupon(id) {
  return request({
    url: '/coupon/coupon/publishAllItemsInCoupon/' + id,
    method: 'post'
  })
}

// 查询优惠券信息
export function getCoupon(id) {
  return request({
    url: '/coupon/coupon/accessCouponInformationByCouponId/' + id,
    method: 'post'
  })
}

// 新增优惠卷
export function addCoupon(data) {
  return request({
    url: '/coupon/coupon/add',
    method: 'post',
    data
  })
}

// 优惠券失效
export function updateCoupon(id) {
  return request({
    url: '/coupon/coupon/couponExpired/'+ id,
    method: 'post'
  })
}

// 优惠券删除
export function delCoupon(id) {
  return request({
    url: '/coupon/coupon/couponDeletion/' + id,
    method: 'post'
  })
}
  export function placeOrder(data) {
  return request({
    url: '/coupon/order/placeOrder/',
    method: 'post',
    data: data
  })
}
export function orderStatus(orderNumber) {
  return request({
    url: '/coupon/order/order/status/'+orderNumber,
    method: 'get'
  })
}
